var menuRight = "div#portal-column-two div.visualPadding";
var menuLeft = "div#portal-column-one div.visualPadding";
var docMain = "div#portal-column-content";
var docColOne = "div#portal-column-one";
var docColTwo = "div#portal-column-two";

function bindTooltips(){
	/*jq("li.bubblemenu a#glossaryAZitem").tooltip({
		position: 'bottom center', 
		opacity: 0.9, 
		predelay: 1,
    });*/
}


jQuery(document).ready(
	function(){
				//jQuery(menuRight).length
				if(false){
					var menuOffset = jQuery(menuRight).offset();
					var menuOffsetTop = menuOffset.top;
					var dmH = jQuery(window).height();
					var crH = jQuery(docColTwo).height();
					var mrW = jQuery(menuRight).width();
					var topPos = jQuery(menuRight).offset().top;
					
					//console.log("Window Height: "+ dmH.toString() + " Portlet Height " + crH.toString());
					
					if(crH < dmH){
					jQuery(window).scroll(function(e){
						var docScroll = jQuery(this).scrollTop();
						var menuTop = jQuery(menuRight).css("top");
						//var lString = "Menu Top: " + menuTop + " Doc Top: " + docScroll;
						//console.log(lString);
						var menuPos = jQuery(menuRight).css("position");
						
						if(docScroll >= menuOffsetTop){
							jQuery(menuRight).css("position","absolute");
							jQuery(menuRight).css("width", mrW);
							$(menuRight).css("top",docScroll + "px");
							e.preventDefault();
						}else{
							jQuery(menuRight).css("position","inherit").css("top",topPos);
						}
					});
					}
				
				}

				//!jQuery(menuLeft).length
				if(false){
					var menuOffset = jQuery(menuLeft).offset();
					var menuOffsetTop = menuOffset.top;
					var dm1H = jQuery(window).height();
					var cr1H = jQuery(docColOne).height();
					var topPos = jQuery(menuLeft).offset().top;
					var mlW = jQuery(menuLeft).width();
					//console.log("Window Height: "+ dmH.toString() + " Portlet Height " + crH.toString());
					
					if(cr1H < dm1H){
					jQuery(window).scroll(function(e){
						var docScroll = jQuery(this).scrollTop();
						var menuTop = jQuery(menuLeft).css("top");
						var menuPos = jQuery(menuLeft).css("position");
						
						if(docScroll >= menuOffsetTop){
							jQuery(menuLeft).css("position","absolute");
							jQuery(menuLeft).css("top",docScroll + "px");
							jQuery(menuLeft).css("width",mlW);
							e.preventDefault();
						}else{
							jQuery(menuLeft).css("position","inherit").css("top",topPos);
						}
					});
					}
				
				}
				
				jQuery("a#noTranslation").each(
					function(){
						jQuery(this).click(
							function(event){
								msgs = jQuery("#noTranslationNotice").text()
								//event.preventDefault();
								}
						);
						}
				);
			bindTooltips();
		}

);

